//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <bsp.h>
#include <6410addr.h>

EXTERN_C void NotifyByIsr(int eType, int nCode, void *pParam);

EXTERN_C void CDECL BspIdle()
{
    //Notify CPU PowerManager module
    //NotifyByIsr(82, 0, NULL);
}

EXTERN_C void CDECL BspHalt()
{
    // BUG: Not implement
    while (TRUE) {
    }
}

STATIC void WatchdogReset()
{
    rWTDAT = 0xffff;     //TODO:confirm delay time
    rWTCON |= (1 << 5) | (1 << 0);//En WatchDog && Reset En

    while (TRUE) {
    }
}

EXTERN_C void CDECL BspReboot()
{
    //BUGBUG: Watchdog reset will reset monahans RTC info
    WatchdogReset();
    assert(0 && "can not reach here");
}
